﻿/*
 * jquery.spellchecker.JQuerySpellCheckerHandler.ashx - jQuery Spell Checker ASP.NET server-side implementation
 * Copyright (c) 2010, 2011 Richard Willis, Jack Yang
 * MIT license  : http://www.opensource.org/licenses/mit-license.php
 * jQuery plugin library written by Richard Willis (willis.rh@gmail.com): http://jquery-spellchecker.googlecode.com
 * .NET port done by Jack Yang (jackmyang@gmail.com)
 */

using NHunspell;
using System;
using System.Collections.Generic;
using System.Net;
using System.Text;
using System.Web;
using System.Xml;
using System.Linq;

namespace SpellChecker
{
    public class JQuerySpellCheckerHandler : IHttpHandler
    {
        public void ProcessRequest(HttpContext context)
        {
            string driver = context.Request.Form["driver"];
            string action = context.Request.Form["action"];
            string lang = context.Request.Form["lang"];
            var spell = new SpellCheckerMain(driver, lang, action, context);
           
            context.Response.ContentType = "application/js";
            context.Response.Write(spell.Excute());
        }

        public bool IsReusable
        {
            get { return false; }
        }
    }
}